package me.ivps.android.testdemo;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class SenderActivity extends Activity {
    
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        setContentView(R.layout.activity_sender);
        
        final EditText editText = (EditText) findViewById(R.id.ed_edit_text);
        findViewById(R.id.btn_send).setOnClickListener(
                new View.OnClickListener() {
                    
                    @Override
                    public void onClick(View v) {
                        final CharSequence msg = editText.getText();
                        startActivity(ReceiverActivity.newIntent(
                                SenderActivity.this, msg));
                    }
                });
    }
}
